<template>
	<view class="flex align-center justify-center">
		<button class="cu-btn round bg-red submit margin-right-xs" v-if="orderInfo.status == '1'"
			@tap="onCancel">取消订单</button>
		<button class="cu-btn round bg-red submit margin-right-xs" v-if="orderInfo.status == '2'"
			@tap="onDeliver">订单发货</button>
		<button class="cu-btn round bg-red submit margin-right-xs" v-if="orderInfo.status == '3'"
			@tap="onLogistics">查看物流</button>
		<button class="cu-btn round bg-red submit margin-right-xs" v-if="orderInfo.status == '11'"
			@tap="onDel">删除订单</button>
		<button class="cu-btn round bg-blue submit margin-left-xs" v-if="type=='list'" @tap="onDetail">查看详情</button>
	</view>
</template>

<script>
	export default {
		props: {
			orderInfo: {
				type: Object,
				default: () => ({})
			},
			type: {
				type: String,
				default: 'list'
			}
		},
		data() {
			return {}
		},
		methods: {
			onCancel() {

			},
			onDeliver() {
				uni.navigateTo({
					url: "/pages/mall/orderinfo/order-deliver/index?logisticsId=" + this.orderInfo
						.orderLogisticsId
				})
			},
			onLogistics() {
				uni.navigateTo({
					url: "/pages/mall/orderinfo/order-logistics/index?logisticsId=" + this.orderInfo
						.orderLogisticsId
				})
			},
			onDel() {

			},
			onDetail(id) {
				uni.navigateTo({
					url: "/pages/mall/orderinfo/order-detail/index?id=" + this.orderInfo.id
				})
			},

		}
	}
</script>

<style>
</style>
